#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>

void* my_memchr(void* str, int find, size_t num)
{
	int ret = NULL;
	while (num--)
	{
		if (*(char*)str == find)
		{
			return str;
		}
		str = (char*)str + 1;
	}
	return ret;
}

int main()
{
	char arr[20] = "abcdef";
	char ch = 'h';
	char* ret = my_memchr(arr, ch, 10);
	printf("%p\n", arr);
	printf("%p\n", ret);
	return 0;
}

//int main()
//{
//	char arr[20] = "abcdef";
//	char ch = 'd';
//	char* ret = memchr(arr, ch, 10);
//	printf("%p\n", arr);
//	printf("%p\n", ret);
//	return 0;
//}